import request from '@/config/axios'

// 文章评价 VO
export interface ArticleScoreVO {
  id: number // ID
  articleId: number // 文章id
  score: number // 评分
  mid: number // 用户
}

// 文章评价 API
export const ArticleScoreApi = {
  // 查询文章评价分页
  getArticleScorePage: async (params: any) => {
    return await request.get({ url: `/cms/article-score/page`, params })
  },

  // 查询文章评价详情
  getArticleScore: async (id: number) => {
    return await request.get({ url: `/cms/article-score/get?id=` + id })
  },

  // 新增文章评价
  createArticleScore: async (data: ArticleScoreVO) => {
    return await request.post({ url: `/cms/article-score/create`, data })
  },

  // 修改文章评价
  updateArticleScore: async (data: ArticleScoreVO) => {
    return await request.put({ url: `/cms/article-score/update`, data })
  },

  // 删除文章评价
  deleteArticleScore: async (id: number) => {
    return await request.delete({ url: `/cms/article-score/delete?id=` + id })
  },

  // 导出文章评价 Excel
  exportArticleScore: async (params) => {
    return await request.download({ url: `/cms/article-score/export-excel`, params })
  }
}